package com.dbapp.shopping.service;

import com.dbapp.shopping.domain.Good;
import com.dbapp.shopping.domain.GoodOwner;
import com.dbapp.shopping.domain.Record;
import com.dbapp.shopping.domain.User;
import java.util.List;
import java.util.Optional;

public interface Service {
    List<Good> getAllGoods();
    List<Good> searchGoods(String query);
    List<Good> findGoodsByUser(User user);
    List<Record> findRecordsByUser(User user);

    Good saveGood(Good good);
    Optional<Good> getGoodById(Long id);

    User saveUser(User user);
    User findSeller(Good good);
    User getUserByUsername(String username);
    Optional<User> getUserById(Long id);

    GoodOwner saveGoodOwner(GoodOwner goodOwner);
    Optional<GoodOwner> getGoodOwnerByGood(Good good);

    Record saveRecord(Record record);

    void deleteGoodsById(Long id);
    void deleteOrder(Long id);

    Boolean isPrice(String price);
    Boolean isStock(String Stock);
}
